package com.springmvc.cto51.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class HelloControllerExt extends AbstractController {


    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest req, HttpServletResponse resp) {
        String hello = req.getParameter("hello");
        System.out.println("----:" + hello);

        //这里的参数就是视图中jsp去掉前后缀的名字
        ModelAndView mav = new ModelAndView("main");
        mav.addObject("hello1", "你好：" + hello);
        return mav;
    }


}
